from haystack.utils import Highlighter
from django.utils.html import strip_tags

class CompleteHighlighter(Highlighter):

    def highlight(self, text_block):
        self.text_block = strip_tags(text_block)
        highlight_locations = self.find_highlightable_words()
        return self.render_html(highlight_locations, 0, len(self.text_block))
